home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 10466 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.1 KB

  1. Path: ix.netcom.com!news
  2. From: miker3@ix.netcom.com (Mike Rubenstein)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: fflush and Visual C++
  5. Date: Mon, 18 Mar 1996 00:23:01 GMT
  6. Organization: Netcom
  7. Message-ID: <314cab43.174488401@nntp.ix.netcom.com>
  8. References: <4idhv5$dnv@news.mhv.net> <314b173b.71056173@nntp.ix.netcom.com> <4ifuuf$fha@solutions.solon.com> <314c3a5f.145588955@nntp.ix.netcom.com> <4ii027$n7c@solutions.solon.com>
  9. NNTP-Posting-Host: ix-dc12-26.ix.netcom.com
  10. X-NETCOM-Date: Sun Mar 17  6:21:45 PM CST 1996
  11. X-Newsreader: Forte Agent .99d/32.182
  12.  
  13. seebs@solutions.solon.com (Peter Seebach) wrote:
  14.  
  15. > In article <314c3a5f.145588955@nntp.ix.netcom.com>,
  16. > Mike Rubenstein <miker3@ix.netcom.com> wrote:
  17. > >What's incorrect?  Are you claiming that Visual C does not implement
  18. > >fflush() correctly?
  19. > No.  I'm claiming that it's incorrect to say that fflush(stdin) does not
  20. > flush input buffers.  It's just also incorrect to say that it does.
  21.  
  22. Strange view.  The question concerned Visual C++ and, as far as I
  23. know, fflush(stdin) never flushes input buffers in that compiler.
  24. Looking at the source code for fflush() I don't see how it could.  I
  25. will stand on my original statement than in Visual C++ fflush(stdin)
  26. does not flush input buffers.
  27.  
  28. > >And claiming that someone is wrong for saying that a function doesn't
  29. > >do something when the language definition does not define it as doing
  30. > >it is rather pedantic.  Sure, it is true (as I point out) that
  31. > >fflush(stdin) can do anything, but I'd not suggest using it when you
  32. > >want to format your hard disk -- there are quite a few implementations
  33. > >that will not do that. :-)
  34. > Yes, it's quite pedantic.  But it's a significant distinction; an
  35. > implementation is allowed to do anything, including what you expect,
  36. > when you do something wrong.
  37.  
  38. A distinction that I pointed out in my original post:
  39.  
  40.     fflush() with stdin as an argument results in undefined
  41.     behavior.
  42.  
  43. Or don't you understand what "undefined behavior" means?  I'm sorry I
  44. assumed that people would know what a term defined in the standard and
  45. often discussed here means.
  46.  
  47.  
  48. Michael M Rubenstein
  49.